;(function($){

	$.showMapObj = {
		options:{},
		data:{},
		init:function(options){
			$.showMapObj.options = options = _initOptions(options);
            //alert(options.dataURL );
			$.showMapObj.data.map = _getServerData( options.dataMapURL );
			$.showMapObj.data.table = _getServerData( options.dataURL );
			$.showMapObj.data.dataStructure = _convertStructure( options.dataStructure );

			return $.showMapObj;
		}
	}

	function _initOptions(options){

		var options = $.extend({
			dataMapURL		:'',
			dataURL			:'',
			dataPageURL		:'',
			dataSubmitURL	:'',
			dataStructure	:''
		},options)

		return options;
	}

	function _getServerData(url){
		if(url == '') return {'tip':'not url'};
		var _tmpData;
        $.ajax({
            url:url,
            type:'GET',
            async:false,
            dataType:'json',
            error:function(e){
            	_tmpData = { error : e };
            },
            success:function(data){
                _tmpData = data;
            }
        });
        //alert('a');
        return _tmpData;
	}

	function _convertStructure(data){

		var _data = data.split(',')

		if( _data.length > 0 ){
			return _data;
		}else{
			alert('dataStructure:格式错误无法解析请确认');
		}
	}

})(jQuery)